#include <stdio.h>
#include <unistd.h> // Unix Standard 头文件
#include <fcntl.h> 
#include <errno.h>
#include <string.h>


int main(int argc, char *argv[]) 
{   
    int fd, fd2;
    // fd = open("./dict.txt", O_RDONLY);
    fd = open("open2.c", O_WRONLY);  
    fd2 = open("cp.c", O_WRONLY);  
    printf("fd = %d, error = %d:%s\n", fd, errno, strerror(errno));
    printf("fd2 = %d, error = %d:%s\n", fd2, errno, strerror(errno));

    close(fd);
    
    return 0;
}